package hn.sigit.dao.ladm.administrative;

import org.hibernate.Criteria;
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;

import hn.sigit.model.ladm.administrative.LA_BAUnit;
import hn.sigit.dao.SigitDAO;

public class LA_BAUnitDAO extends SigitDAO<LA_BAUnit> {
	private static final long serialVersionUID = 1L;
	
	
	public static LA_BAUnit loadBAUnitById(long baUnitId) {
		return loadBAUnitById(getSession(), baUnitId);
	}
	
	public static LA_BAUnit loadBAUnitById(Session session, long baUnitId) {
		Criteria criteria = session.createCriteria(LA_BAUnit.class);
		criteria.add(Restrictions.eq("uID", baUnitId));
		
		return (LA_BAUnit)criteria.uniqueResult();
	}

}
